package com.workshop.entity;

import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotations.Version;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author chengluqiang
 * @since 2019-04-13
 */
@Data
@Accessors(chain = true)
public class ACategory extends Model<ACategory> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 分类名称
     */
    private String name;
    /**
     * 上级分类
     */
    @TableField("parentId")
    private Integer parentId;
    /**
     * 层级显示 不能为null 1=一级 2=二级 限制在3级以内
     */
    private Integer depth;
    /**
     * 层级关系解析 例如 -id-id-
     */
    private String parse;
    private Date createTime;
    private Date updateTime;


    public static final String ID = "id";

    public static final String NAME = "name";

    public static final String PARENTID = "parentId";

    public static final String DEPTH = "depth";

    public static final String PARSE = "parse";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_TIME = "update_time";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
